<template>
<div>
  <el-button type="primary" @click ="resetPassword">更改密码</el-button>

  <resetPasswordPage v-if="isReset"></resetPasswordPage>
</div>
</template>

<script>
import resetPasswordPage from '@/components/resetPasswordPage'
export default {
  components:{
    resetPasswordPage
  },

  data(){
    return{
      isReset : false, 
    }
  },

  methods:{
    resetPassword(){
      this.$cookie.set( "token" ,'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NCwidXNlcm5hbWUiOiJ0ZXN0IiwicGFzc3dvcmQiOiIiLCJuaWNrbmFtZSI6Iua1i-ivleeUqOS-iyIsImVtYWlsIjoidGVzdDEyMzQ1NkBxcS5jb20iLCJ1c2VyX3BpYyI6IiIsImlhdCI6MTY1MTI5MjQ1MiwiZXhwIjoxNjUxMzI4NDUyfQ.2SEMpNAUmt3D8QvLZd06gQ9GHAVZuU3u7t2F9jFbxuY', 1)

      const token = this.$cookie.get('token')
      if(token === null){
        this.$alert('请先登录！！！', '', {
          confirmButtonText: '确定',
        })
      }else{
        this.isReset = true
      }
    }
  }

}
</script>

<style>

</style>